<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:p="http://primefaces.org/ui">

<ui:composition template="/layouts/template.xhtml">
	<ui:define name="body">
		<h:form id="form" acceptcharset="ISO-8859-1">
			<f:metadata>
				<f:viewParam name="param" value="#{serviceItemBean.param}"/>
			</f:metadata>

			<p:panel header="#{msgs['massai.serviceItem.header.register']}">
				<h:panelGrid cellspacing="1" cellpadding="0">
					<h:panelGrid>
						<p:outputLabel for="category" value="#{msgs['massai.serviceItem.categoryLevel']}" />
						<p:selectOneMenu 
							id="category" tabindex="1" value="#{serviceItemBean.serviceItem.categoryLevel}"
							style="width: 350px;" label="#{msgs['massai.serviceItem.categoryLevel']}"
							required="true" requiredMessage="Categoria #{msgs['common.required.field']}"
							converter="entityConverter">
							<f:selectItems value="#{serviceItemBean.listCategoryLevel()}" />
							<f:converter converterId="entityConverter"/>
						</p:selectOneMenu>
					</h:panelGrid>

					<h:panelGrid>
						<p:outputLabel for="unitMeasure" value="#{msgs['massai.serviceItem.unitMeasure']}" />
						<p:selectOneMenu 
							id="unitMeasure" tabindex="3" value="#{serviceItemBean.serviceItem.unitMeasure}"
							style="width: 258px;" label="#{msgs['massai.serviceItem.unitMeasure']}"
							required="true" requiredMessage="Und. Medida #{msgs['common.required.field']}"
							converter="entityConverter">
							<f:selectItems value="#{serviceItemBean.listUnitMeasure()}" />
						</p:selectOneMenu>
					</h:panelGrid>

					<h:panelGrid>
						<p:outputLabel value="#{msgs['massai.serviceItem.description']}" for="description" />
						<p:inputText id="description" style="width: 343px;" tabindex="4"
							required="true" requiredMessage="Descrição #{msgs['common.required.field']}"
							value="#{serviceItemBean.serviceItem.description}" maxlength="255" />
					</h:panelGrid>
				</h:panelGrid>

				<p:spacer height="25px" />

				<h:panelGrid style="width: 100%;">
					<h:panelGrid style="float: right;" columns="2">
						<p:commandButton value="#{msgs['common.back']}" style="padding: 1px !important;"
							action="serviceItemConsult" ajax="false" immediate="true" tabindex="5" />

						<p:commandButton tabindex="6" value="#{msgs['common.save']}"
							actionListener="#{serviceItemBean.save()}" ajax="false" 
							style="margin-right: 5px;" styleClass="buttonSave" update=":form"
							rendered="#{sessionBean.showAction('supportServiceItem', 'insert')}" />
					</h:panelGrid>
				</h:panelGrid>
			</p:panel>
		</h:form>
	</ui:define>
</ui:composition>
</html>